

using System;
using System.Text;

using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using NHibernate.Exceptions;

using SpotifyGenNHibernate.EN.Spotify;
using SpotifyGenNHibernate.CAD.Spotify;

namespace SpotifyGenNHibernate.CEN.Spotify
{
        public partial class ArtistaCEN
        {
        private IArtistaCAD _IArtistaCAD;

        public ArtistaCEN(IArtistaCAD _IArtistaCAD)
        {
                this._IArtistaCAD = _IArtistaCAD;
        }

        public int New_ (String p_nombre, String p_biografia, String p_imagen)
        {
                ArtistaEN artistaEN = null;
                int oid;

                //Initialized ArtistaEN
                artistaEN = new ArtistaEN ();
                artistaEN.Nombre = p_nombre;
                artistaEN.Biografia = p_biografia;
                artistaEN.Imagen = p_imagen;
                //Call to ArtistaCAD

                oid = _IArtistaCAD.New_ (artistaEN);
                return oid;
        }

        public void Destroy (int id)
        {
                _IArtistaCAD.Destroy (
                        id

                        );
        }

        public void Editar (int p_Artista_OID, String p_nombre, String p_biografia, String p_imagen)
        {
                ArtistaEN artistaEN = null;

                //Initialized ArtistaEN
                artistaEN = new ArtistaEN ();
                artistaEN.Id = p_Artista_OID;
                artistaEN.Nombre = p_nombre;
                artistaEN.Biografia = p_biografia;
                artistaEN.Imagen = p_imagen;
                //Call to ArtistaCAD

                _IArtistaCAD.Editar (artistaEN);
        }

        public System.Collections.Generic.IList<ArtistaEN> Buscar (int p_oid)
        {
                return _IArtistaCAD.Buscar (p_oid);
        }
        public System.Collections.Generic.IList<ArtistaEN> Consultar (int first, int size)
        {
                System.Collections.Generic.IList<ArtistaEN> list = null;

                list = _IArtistaCAD.Consultar (first, size);
                return list;
        }
        }
}
